@import "../style.less";

// ==========================================
// 变量定义
// ==========================================
@card-height: calc(100% - 42px - 13px); // 左右卡片内容高度定义 目前卡片为等高
@primary-color: #00ffff;
@text-color: #ffffff;
@text-light-color: #aeddff;
@link-color: #00ccff;
@border-color: rgba(0, 153, 255, 0.3);
@bg-dark: rgba(0, 20, 40, 0.5);
@bg-light: rgba(0, 10, 30, 0.3);
@bg-hover: rgba(0, 60, 120, 0.3);

// ==========================================
// 动画定义
// ==========================================
@keyframes pulse {
  0% {
    opacity: 0.3;
    transform: translate(-50%, -50%) scale(0.8);
  }
  50% {
    opacity: 0.6;
    transform: translate(-50%, -50%) scale(1.1);
  }
  100% {
    opacity: 0.3;
    transform: translate(-50%, -50%) scale(0.8);
  }
}

// ==========================================
// 知识产权概览组件
// ==========================================
.ip-overview-container {
  width: 100%;
  height: 100%;
  display: flex;
  position: relative;
  
  // 左侧容器
  .ip-overview-left-container {
    width: 50%;
    height: 100%;
    
    .ip-overview-left-img {
      margin-left: 14%;
      width: 80%;
      height: 100%;
    }
  }
  
  // 右侧容器
  .ip-overview-right-container {
    width: 50%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: start;
    justify-content: center;
    
    // 文本样式
    .ip-overview-text {
      display: flex;
      flex-direction: column;
      align-items: start;
      justify-content: center;
      background-image: url("/assets/img/text-background.png");
      background-size: 100% 100%;
      background-position: right;
      background-repeat: no-repeat;
      padding-left: 30px;
      position: relative;

      // 虚线装饰
      .ip-overview-dashed-line {
        position: absolute;
        left: -25px;
        width: 50px;
        height: 1px;
        border-top: 1px dashed @primary-color;

        &::after {
          content: "";
          position: absolute;
          right: 0;
          top: -2.5px;
          width: 5px;
          height: 5px;
          background-color: @primary-color;
        }
      }

      // 标题和值
      .ip-overview-text-title {
        font-family: SourceHanSansCN-Regular;
        font-weight: 400;
        font-size: 14px;
        color: @text-light-color;
        letter-spacing: 0;
        position: relative;
        z-index: 1;
      }
      
      .ip-overview-text-value {
        font-family: YouSheBiaoTiHei;
        font-size: 19px;
        color: @text-color;
      }
    }
    
    // 右侧顶部区域
    .ip-overview-right-top {
      width: 80%;
      height: 25%;

      .ip-overview-dashed-line {
        top: 60%;
      }
    }
    
    // 右侧中部区域
    .ip-overview-right-center {
      width: 90%;
      height: 25%;
      
      .ip-overview-text-value {
        padding: 0 10px;
      }
      
      .ip-overview-dashed-line {
        top: 60%;
        width: 60px;
      }
    }
    
    // 右侧底部区域
    .ip-overview-right-bottom {
      width: 100%;
      height: 25%;
      background-image: url("/assets/img/text-background-yellow.png");
      
      .ip-overview-text-value {
        padding: 0 20px;
      }
      
      .ip-overview-dashed-line {
        top: 60%;
        left: -35px;
        width: 80px;
      }
    }
  }
}

// ==========================================
// 知识产权占比圆环图组件
// ==========================================
.ip-chart-container {
  width: 45%;
  height: 80%;
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: transparent;
  position: relative;

  // 外层光晕效果
  &::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(
      circle at center,
      rgba(0, 50, 100, 0.1) 0%,
      rgba(0, 20, 40, 0) 70%
    );
    pointer-events: none;
  }

  // 内层脉冲效果
  &::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 150px;
    height: 150px;
    transform: translate(-50%, -50%);
    background: radial-gradient(
      circle at center,
      rgba(0, 150, 255, 0.1) 0%,
      rgba(0, 80, 150, 0) 70%
    );
    border-radius: 50%;
    pointer-events: none;
    animation: pulse 3s infinite ease-in-out;
  }

  // 图表画布
  .ip-chart-canvas {
    max-width: 100%;
    max-height: 100%;
    cursor: pointer;
    background-color: transparent;
    filter: drop-shadow(0 0 5px rgba(0, 150, 255, 0.3));
    position: relative;
    z-index: 1;
  }
}

// 图表文本说明
.ip-chart-text {
  width: 55%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;

  .ip-chart-text-item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
  }

  .ip-chart-text-item-color {
    width: 12px;
    height: 12px;
    border-radius: 2px;
    margin-right: 5px;
  }

  .ip-chart-text-item-title {
    color: @text-color;
    font-size: 12px;
    margin-right: 5px;
  }

  .ip-chart-text-item-value {
    color: @text-color;
    font-size: 12px;
  }
}

// ==========================================
// 部门排名组件
// ==========================================
.department-rank-container {
  width: 100%;
  height: 100%;
  display: flex;
  padding: 16px;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  overflow-y: auto;
  scrollbar-width: none;
  
  // 部门排名项
  .department-rank-item {
    width: 100%;
    height: 20%;
    margin-bottom: 5px;
    display: flex;
    align-items: start;
    flex-direction: column;
    justify-content: flex-start;
    
    // 部门排名顶部
    .department-rank-item-top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      
      .department-rank-badge {
        font-style: italic;
      }
      
      .department-rank-item-name {
        margin-left: 10px;
      }
    }
    
    // 部门排名分数
    .department-rank-item-score {
      display: flex;
      align-items: center;
      justify-content: space-between;
      width: 100%; /* 确保进度条容器有宽度 */
    }
  }
}

// ==========================================
// 知识产权链表格组件
// ==========================================
.ip-chain-container {
  width: 100%;
  height: 100%;
  padding: 10px;
  overflow: hidden; // 隐藏外部容器滚动条
  display: flex;
  flex-direction: column;
  
  // 表格
  .ip-chain-table {
    width: 100%;
    height: 100%;
    border-collapse: collapse;
    color: @text-color;
    table-layout: fixed;
    display: flex;
    flex-direction: column;
    
    // 单元格通用样式
    th, td {
      padding: 12px 15px;
      text-align: center;
      border-bottom: 1px solid @border-color;
    }
    
    // 表头样式
    th {
      font-weight: bold;
      color: @text-light-color;
    }
    
    thead {
      display: table;
      width: 100%;
      table-layout: fixed;
      background-color: @bg-dark;
    }
    
    // 表体样式
    tbody {
      display: block;
      width: 100%;
      overflow-y: auto;
      overflow-x: hidden;
      flex: 1;
      scrollbar-width: none; // Firefox
      -ms-overflow-style: none; // IE and Edge
      
      &::-webkit-scrollbar {
        display: none; // Chrome, Safari, Opera
      }
    }
    
    tbody tr {
      display: table;
      width: 100%;
      table-layout: fixed;
      background-color: @bg-light;
      transition: background-color 0.3s;
      
      &:hover {
        background-color: @bg-hover;
      }
    }
    
    // 列宽设置
    th:nth-child(1), td:nth-child(1) {
      width: 40%;
    }
    
    th:nth-child(2), td:nth-child(2) {
      width: 30%;
    }
    
    th:nth-child(3), td:nth-child(3) {
      width: 30%;
    }
    
    // 操作链接
    .view-details {
      color: @link-color;
      cursor: pointer;
      text-decoration: none;
      
      &:hover {
        text-decoration: underline;
      }
    }
  }
}

// ==========================================
// 天气组件
// ==========================================
._weather_container {
  // 天气信息
  .weather-info {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  
  // 天气图标基础样式
  .weather-icon {
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-right: 5px;
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center;
  }
  
  // 不同天气类型的图标
  .weather-icon-sunny {
    background-image: url('/assets/img/weather/sunny.png');
  }
  
  .weather-icon-cloudy {
    background-image: url('/assets/img/weather/cloudy.png');
  }
  
  .weather-icon-overcast {
    background-image: url('/assets/img/weather/overcast.png');
  }
  
  .weather-icon-light-rain {
    background-image: url('/assets/img/weather/light-rain.png');
  }
  
  .weather-icon-heavy-rain {
    background-image: url('/assets/img/weather/heavy-rain.png');
  }
}
